package com.ruoyi.project.domain.dto;

import cn.hutool.core.bean.BeanUtil;
import com.ruoyi.project.domain.entity.DictData;
import com.ruoyi.project.domain.entity.Dingdan;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 订单(Dingdan)表DTO层
 *
 * @author yanweichao
 * @since 2025-06-20
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class DingdanDTO extends Dingdan {

    private static final long serialVersionUID = 1L;

    private String keyword;

    public List<String> ysyqList;
    public List<Ptcp> ptcpList;

    public boolean isNew() {
        return this.getId() == null;
    }

    public static DingdanDTO of(Dingdan data) {
        DingdanDTO dto = new DingdanDTO();
        BeanUtil.copyProperties(data, dto);
        return dto;
    }

    @Data
    public static class Ptcp {
        private String cpzl;
        private String ypmc;
        private String guige;
        private String caizhi;
        private Integer sum;
        private String ysfs;
        private String yanse;
        private String beizhu;
    }
}
